<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>$!{i18n.get("system","mng")}</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  #parse('/headFiles.html')
</head>
<body>
<div class="layui-form" lay-filter="LAY-form" id="LAY-form" style="padding: 20px 30px 0 0;">
	<input type="hidden" name="id" value="$!{id}"/>
    <div class="layui-form-item">
      <label class="layui-form-label">姓名</label>
      <div class="layui-input-block">
        <input type="text" name="name" lay-verify="required" placeholder="$!{i18n.get('pleaseEn','name')}" autocomplete="off" class="layui-input" value="$!{name}">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">手机号</label>
      <div class="layui-input-block">
        <input type="text" name="phone" lay-verify="required" placeholder="$!{i18n.get('pleaseEn','phone')}" autocomplete="off" class="layui-input" value="$!{phone}">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">角色</label>
      <div class="layui-input-block">
      	<div id="roles"></div>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">登录账号</label>
      <div class="layui-input-block">
        <input type="text" name="loginName" lay-verify="required" placeholder="请输入登录账号" autocomplete="off" class="layui-input" value="$!{loginName}">
      </div>
    </div>
    #if(!$id)
    <div class="layui-form-item">
        <label class="layui-form-label">登录密码</label>
        <div class="layui-input-block">
            <input type="password" name="loginPwd" lay-verify="required" placeholder="请输入登录密码" autocomplete="off" class="layui-input">
        </div>
    </div>
    #end
    <div class="layui-form-item layui-hide">
      <input type="button" lay-submit lay-filter="LAY-form-submit" id="LAY-form-submit" value="$!{i18n.get('submit')}">
      <input type="button" lay-submit lay-filter="LAY-form-update" id="LAY-form-update" value="$!{i18n.get('update')}">
    </div>
</div>

#parse('/footFiles.html')
<script type="text/javascript">
  layui.config({
    base: '$!{webRoot}/assets/layuiadmin/'
  }).extend({
    index: 'lib/index'
  }).use(['index', 'form', 'selectM'], function(){
    var $ = layui.$,form = layui.form,selectM = layui.selectM;
    
    selectM({
      elem: '#roles'
      ,data:'$!{webRoot}/sys/role/select.data'
      ,max:5
      ,verify:'required'
      ,selected:'$!{roles}'
    });
  });
</script>
</body>
</html>